package com.bolang.onlycode.demo.ThreadLocal;

import org.apache.poi.ss.formula.functions.T;

import java.util.concurrent.locks.LockSupport;

public class MyThreadLocal {
    public static void main(String[] args) {
        ThreadLocal<Integer> local1=new ThreadLocal();
        ThreadLocal<Integer> local2=new ThreadLocal();
        local1.set(1);
        Thread t0 = new Thread(new Runnable() {
            @Override
            public void run() {
                Thread current = Thread.currentThread();
                local1.set(1);//@ThreadLocal502    thread t0 @499   threadloaclmap  @510  table 513
                local2.set(2);//@ThreadLocal503
//                System.out.println(local1.get());
                System.out.println(Thread.currentThread().getName());
            }
        });
        t0.start();
        Thread t1 = new Thread(new Runnable() {
            @Override
            public void run() {
                Thread current = Thread.currentThread();
                local1.set(3);//@ThreadLocal502 threadlocalmap @550  table@553
                local2.set(4);//@ThreadLocal503
//                System.out.println(local1.get());
            }
        }, "t1");
        t1.start();
        int i=0;
       local1.remove();
        System.out.println(local1.get());
    }




}
